<%@ page contentType="text/html;charset=UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<c:set var="extLibs" value="validate,fileupload"/>
<sys:header title="会员管理 - ${member.isNewRecord ? '新增' : '编辑'}会员" extLibs="${extLibs}" htmlClass="scroll"/>
<div class="portlet box ${boxStyleColor} autoHeight">
	<div class="portlet-body form">
		<form:form id="inputForm" modelAttribute="member" action="${ctx}/mdm/member/doApprove1" method="post" class="form-horizontal">
			<div class="table-fdiv">
				<h3>会员信息</h3>
				<table class="table-form">
					<tr class="table-caption"><td colspan="7">基本信息</td></tr>
					<tr class="hide"><td><form:hidden path="id"/> <form:hidden path="approveStatus"/><td></tr>
					<tr>
						<td class="lbl" width="120">姓名：</td>
						<td>
							<form:input path="name" htmlEscape="false" maxlength="64" class="form-control required"/>
						</td>
						<td class="lbl" width="100">性别：</td>
						<td>
							<form:select path="sex" multiple="false" class="form-control required input-sm"  >
								<form:options items="${fns:getDictList('sex')}" itemLabel="name" itemValue="value" htmlEscape="false"/>
							</form:select>
						</td>
						<td class="lbl" width="120">生日：</td>
						<td>
							<input name="birthday" type="text" readonly="readonly" maxlength="20" class="form-control Wdate required"
								value="<fmt:formatDate value="${member.birthday}" pattern="yyyy-MM-dd"/>"
								onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
						</td>
						<td class="lbl" width="100"  rowspan="3">
							<div style="width:120px;height:150px;margin:0px auto;">
								<sys:fileupload id="file" bizCategory="mdm_member" bizKey="${member.id}" 
								 uploadType="image" maxUploadNum="1" isMini="true" imageStyle="width:100px;height:120px;"/>
							</div>
						</td>
					</tr>
					<tr>
						<td class="lbl" width="120">文化程度：</td>
						<td>
							<form:select path="culturalLevel" multiple="false" class="form-control required input-sm"  >
								<form:option value="">请选择</form:option>
								<form:options items="${fns:getDictList('education')}" itemLabel="name" itemValue="value" htmlEscape="false"/>
							</form:select>
						</td>
						<td class="lbl" width="100">党派：</td>
						<td>
							<form:select path="partisan" multiple="false" class="form-control required input-sm"  >
								<form:option value="">请选择</form:option>
								<form:options items="${fns:getDictList('partisan')}" itemLabel="name" itemValue="name" htmlEscape="false"/>
							</form:select>
						</td>
						<td class="lbl" width="120">民族：</td>
						<td>
							<form:select path="nation" multiple="false" class="form-control required input-sm"  >
								<form:option value="">请选择</form:option>
								<form:options items="${fns:getDictList('nation')}" itemLabel="name" itemValue="name" htmlEscape="false"/>
							</form:select>
						</td>
					</tr>
					<tr>
						<td class="lbl" width="120">参加工作时间：</td>
						<td>
							<input name="workDate" type="text" readonly="readonly" maxlength="20" class="form-control Wdate required"
								value="<fmt:formatDate value="${member.workDate}" pattern="yyyy-MM-dd"/>"
								onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
						</td>
						<td class="lbl" width="100">籍贯：</td>
						<td>
							<form:input path="nativePlace" htmlEscape="false" maxlength="64" class="form-control required"/>
						</td>
						<td class="lbl" width="120">毕业学校：</td>
						<td>
							<form:input path="graduateSchool" htmlEscape="false" maxlength="64" class="form-control required"/>
						</td>
					</tr>
					<tr>
						<td class="lbl" width="120">所在工会：</td>
						<td width="120">
							<sys:treeselect id="officeCode" name="officeCode" value="${member.officeCode}" labelName="officeName" labelValue="${member.officeName}" 
							 title="单位" url="/sys/office/treeData?isAll=true" cssClass="required"  allowClear="true"/>
						</td>
						<td class="lbl" width="100">职务：</td>
						<td>
							<form:input path="duty" htmlEscape="false" maxlength="64" class="form-control required"/>
						</td>
						<td class="lbl" width="120">现住地址：</td>
						<td colspan="2">
							<form:input path="address" htmlEscape="false" maxlength="64" class="form-control required"/>
						</td>
					</tr>
					<tr class="table-caption"><td colspan="7">家庭主要成员及职业工作单位</td></tr>
					<tr>
						<td class="lbl">称谓</td>
						<td><form:input path="relation1" htmlEscape="false" maxlength="64" class="form-control"/></td>
						<td class="lbl">姓名 </td>
						<td><form:input path="name1" htmlEscape="false" maxlength="64" class="form-control"/></td>
						<td class="lbl">工作单位</td>
						<td colspan="2"><form:input path="organization1" htmlEscape="false" maxlength="64" class="form-control"/></td>
					</tr>
					<tr>
						<td class="lbl">称谓</td>
						<td><form:input path="relation2" htmlEscape="false" maxlength="64" class="form-control"/></td>
						<td class="lbl">姓名 </td>
						<td><form:input path="name2" htmlEscape="false" maxlength="64" class="form-control"/></td>
						<td class="lbl">工作单位</td>
						<td colspan="2"><form:input path="organization2" htmlEscape="false" maxlength="64" class="form-control"/></td>
					</tr>
					<tr>
						<td class="lbl">称谓</td>
						<td><form:input path="relation3" htmlEscape="false" maxlength="64" class="form-control"/></td>
						<td class="lbl">姓名 </td>
						<td><form:input path="name3" htmlEscape="false" maxlength="64" class="form-control"/></td>
						<td class="lbl">工作单位</td>
						<td colspan="2"><form:input path="organization3" htmlEscape="false" maxlength="64" class="form-control"/></td>
					</tr>
					<tr>
						<td class="lbl" width="100">个人简历</td>
						<td colspan="6"><form:textarea path="resume" cols="90" rows="5" class="form-control" maxlength="200"/></td>
					</tr>
					<tr class="table-caption"><td colspan="7">获得荣誉</td></tr>
					<tr>
						<td class="lbl">荣誉名称</td>
						<td>
							<form:select path="honor1" multiple="false" class="form-control required input-sm"  >
								<form:option value=" ">&nbsp;</form:option>
								<form:options items="${fns:getDictList('honor')}" itemLabel="name" itemValue="value" htmlEscape="false"/>
							</form:select>
						</td>
						<td class="lbl">奖项级别</td>
						<td>
							<form:select path="level1" multiple="false" class="form-control required input-sm"  >
								<form:option value=" ">&nbsp;</form:option>
								<form:options items="${fns:getDictList('level')}" itemLabel="name" itemValue="value" htmlEscape="false"/>
							</form:select>
						</td>
						<td class="lbl">获奖时间</td>
						<td colspan="2">
							<input name="date1" type="text" readonly="readonly" maxlength="20" class="form-control Wdate "
									value="<fmt:formatDate value="${member.date1}" pattern="yyyy-MM-dd"/>"
									onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
						</td>
					</tr>
					<tr>
						<td class="lbl">荣誉名称</td>
						<td>
							<form:select path="honor2" multiple="false" class="form-control required input-sm"  >
								<form:option value=" ">&nbsp;</form:option>
								<form:options items="${fns:getDictList('honor')}" itemLabel="name" itemValue="value" htmlEscape="false"/>
							</form:select>
						</td>
						<td class="lbl">奖项级别</td>
						<td>
							<form:select path="level2" multiple="false" class="form-control required input-sm"  >
								<form:option value=" ">&nbsp;</form:option>
								<form:options items="${fns:getDictList('level')}" itemLabel="name" itemValue="value" htmlEscape="false"/>
							</form:select>
						</td>
						<td class="lbl">获奖时间</td>
						<td colspan="2">
							<input name="date2" type="text" readonly="readonly" maxlength="20" class="form-control Wdate "
									value="<fmt:formatDate value="${member.date2}" pattern="yyyy-MM-dd"/>"
									onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
						</td>
					</tr>
					<tr>
						<td class="lbl">荣誉名称</td>
						<td>
							<form:select path="honor3" multiple="false" class="form-control required input-sm"  >
								<form:option value=" ">&nbsp;</form:option>
								<form:options items="${fns:getDictList('honor')}" itemLabel="name" itemValue="value" htmlEscape="false"/>
							</form:select>
						</td>
						<td class="lbl">奖项级别</td>
						<td>
							<form:select path="level3" multiple="false" class="form-control required input-sm"  >
								<form:option value=" ">&nbsp;</form:option>
								<form:options items="${fns:getDictList('level')}" itemLabel="name" itemValue="value" htmlEscape="false"/>
							</form:select>
						</td>
						<td class="lbl">获奖时间</td>
						<td colspan="2">
							<input name="date3" type="text" readonly="readonly" maxlength="20" class="form-control Wdate "
									value="<fmt:formatDate value="${member.date3}" pattern="yyyy-MM-dd"/>"
									onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
						</td>
					</tr>
					<tr class="table-caption"><td colspan="7">审批意见</td></tr>
					<tr>
						<td class="lbl" width="120">分工会主席意见</td>
						<td class="lbl" colspan="6"><form:textarea path="approveMemo1" htmlEscape="false" rows="3" maxlength="200" class="form-control required input-sm"/></td>
					</tr>
				</table>
				<div class="form-actions">
						<c:if test="${member.approveStatus=='1'}">
							<button id="btnSubmit1" type="button" class="btn btn-primary"><i class="fa fa-check"></i> 通过</button>&nbsp;
							<button id="btnSubmit2" type="button" class="btn btn-primary"><i class="fa fa-mail-forward "></i> 退回</button>&nbsp;
						</c:if>
					<button id="btnCancel" type="button" class="btn default" onclick="closeCurrentTabPage('${param.parentTabPageId}')"><i class="fa fa-reply-all"></i> 关 闭</button>
				</div>
			</div>
		</form:form>
	</div>
</div>
<sys:footer extLibs="${extLibs}"/>
<script type="text/javascript">
	$("#inputForm").validate({
		submitHandler: function(form){
			ajaxSubmitForm($(form), function(data){
				showMessage(data.message);
				if(data.result == Global.TRUE){
					closeCurrentTabPage('${param.parentTabPageId}', function(contents, contentWindow){
						contentWindow.page();
					});
				}
			}, "json");
	    }
	});
	
	//通过，提交表单
	$("#btnSubmit1").click(function(){
		$("#approveStatus").val(2);//通过是3
		$("#inputForm").submit();
	});
	
	//退回，提交表单
	$("#btnSubmit2").click(function(){
		$("#approveStatus").val(3);//退回是3
		$("#inputForm").submit();
	});
</script>